package com.ztf0337.mycurriculumdesign.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.ztf0337.mycurriculumdesign.entity.ParkLot;

import java.util.List;

@Dao
public interface ParkLotDao {

    @Insert
    long insert(ParkLot parkLot);
    @Delete
    void delete(ParkLot parkLot);
    @Update
    void update(ParkLot parkLot);
    @Query("SELECT * FROM park_lot_table WHERE id = :id")
    ParkLot getParkLotById(Long id);
    @Query("SELECT * FROM park_lot_table")
    List<ParkLot> getAllParkLots();

    @Query("SELECT * FROM park_lot_table WHERE park_lot_name LIKE '%' || :content || '%'")
    List<ParkLot> searchAllParkLots(String content);

}
